(function(){
	/*
	 * 1.This node can be used as a scene to run a benchmark test of drawing one image(url is src) for many times(count).
	 * 
	 * 2.It also shows how to define your own node:
	 * 
	 * 		a). Create a LibreGE.Node object inside the constructor.
	 * 		b). Add/Set your properties to this Node object.
	 * 		c). Return this Node object.
	 * 
	 */
	LibreGE.node.ImageBenchmarkScene2D = function(src, count){
		var node = new LibreGE.node.Scene2D();
		node.children = new Array(count + 1);
		
		var img = new Image();
		img.src = src;
		for(var i = 0; i < count; i++){
			node.children[i] = new LibreGE.node.Image2D(img);
		}
		
		
		var fps = new LibreGE.node.Text2D('',{
			color : '#ff0000',
			font : 'bold 16px  sans-serif'
		});
		node.children[count] = fps;
		
		
		node.update = function(elapsed, ge){
			var canvasElement = ge.getRenderContext().canvas;
			
			for(var index in node.children){
				node.children[index].x = Math.random() * canvasElement.width;
				node.children[index].y = Math.random() * canvasElement.height;
			}
			fps.txt = ge.fps;
			fps.x = 0;
			fps.y = 0;
		};
		

		
		return node;
	};
})();


